<template>
    <div class="banner" @click="handleClickBanner">
        <img  class="banner-img" :src="bannerImg">
        <div class="banner-info">
            <div class="banner-title">{{this.sightName}}</div>
            <div class="banner-number">
                <span class="iconfont banner-icon">&#xe63a;</span>
                {{this.bannerImg.length}}
            </div>
        </div>
        <common-gallary :imgs="gallaryImgs"
            v-show="isShow"
            @closeGallary="handleGallaryClose"
            ></common-gallary>
    </div>
</template>

<script>
    import CommonGallary from '../../components/common/gallary/Gallary'
    export default {
        name: "DetailBanner",
        components:{
            CommonGallary
        },
        props:{
            sightName:String,
            bannerImg:String,
            gallaryImgs:Array
        },
        data(){
            return{
                isShow : false,
            }
        },
        methods:{
            handleClickBanner(){
                this.isShow =true

            },
            handleGallaryClose(){
                this.isShow =false
            }
        }
    }
</script>

<style lang="stylus" scoped>
    .banner
        position relative
        overflow hidden
        height 0
        padding-bottom: 45%
        .banner-img
            width:100%
        .banner-info
            display flex
            position absolute
            left 0
            right 0
            bottom 0
            line-height .6rem
            background-image linear-gradient(to top,rgba(0,0,0,0),rgba(0,0,0,.8))
            .banner-title
                flex 1
                color: #ccc
                font-size .32rem
                padding  0  .2rem
            .banner-number
                height .32rem
                line-height .32rem
                margin-top .14rem
                padding 0 .4rem
                color: #ccc
                font-size .12rem
                border-radius .2rem
                background rgb(0,0s,0,.8)
                .banner-icon
                    font-size .24rem
</style>